/*
 * Copyright 2002-2017 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.loooooo.pm2024.security.authz;


import com.loooooo.pm2024.exception.MyBaseException;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * @author ytx98
 * @date 2018年7月26日 新建
 */
@SuppressWarnings("serial")
public class AuthzException extends MyBaseException {

    private List<String> permission = new ArrayList();

    public AuthzException() {
        super();
    }

    public AuthzException(String... permission) {
        super("未授权", "NotAllowed", 403);
        this.permission = Arrays.asList(permission);
    }

    public AuthzException(String message, String type, List<String> permission) {
        super(message, type, 403);
        this.permission = permission;
    }

    public List<String> getPermission() {
        return permission;
    }

    public void setPermission(List<String> permission) {
        this.permission = permission;
    }
}
